package com.alibaba.algo.cooperation.feign.service;

import com.alibaba.algo.cooperation.common.BaseResult;
import com.alibaba.algo.cooperation.feign.config.FeignConfiguration;
import com.alibaba.algo.cooperation.feign.vo.enums.FunctionCodeEnum;
import com.alibaba.algo.cooperation.feign.vo.res.AppInfoResVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@FeignClient(url="${feign.userCenterUrl:}", value = "usercenter-service", contextId = "usercenter-app", configuration = FeignConfiguration.class)
@Api(value = "租户管理", tags = "租户管理")
public interface AppFeignService {
    /**
     * 获取全量应用列表
     *
     * @return 应用列表
     */
    @RequestMapping(value = "feignApi/userCenter/app/qryAllAppList", method = RequestMethod.POST)
    @ApiOperation(value = "获取全量应用列表")
    BaseResult<List<AppInfoResVO>> qryAllAppList();

    /**
     * 根据功能编码获取拥有该功能的应用
     *
     * @param functionCode 功能编码
     * @return 应用列表
     */
    @ApiOperation(value = "根据功能编码获取拥有该功能的应用")
    @RequestMapping(value = "feignApi/userCenter/app/qryAppListByFunctionCode", method = RequestMethod.POST)
    BaseResult<List<AppInfoResVO>> qryAllAppList(FunctionCodeEnum functionCode);
}
